 <?php  
 //pr($batchData);
echo $this->session->flash(); 
if(!empty($mailData)){
      $this->Paginator->options(array(
         'update' => '#divUpdate',
         'evalScripts' => true, 
      ));

} ?>
<div class="file" id="List">
    <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#686550">
        <tr class="heading"  bgcolor="#708089">
            <td width="6%" valign="top" align="left"><?php echo __('S.NO') ?></td>
            <td valign="top"  align ="left"><?php echo $this->Paginator->sort('user_id', __('SENT_TO', true)); ?></td>
            <td valign="top"  align="left"><?php echo $this->Paginator->sort('mail_type', __('MAIL_TYPE', true)); ?></td>
            <td valign="top"  align="left"><?php echo $this->Paginator->sort('created', __('SENT_ON', true)); ?></td>
        </tr>
        <?php
        if (isset($mailData) && count($mailData) > 0) {
            $i = 0;
            foreach ($mailData as $arrayDetail) {
                ?>
                <tr class="heading2" bgcolor="#ffffff">
                    <td>&nbsp;<?php echo $i + 1 ?></td>
                    <td>&nbsp;<?php echo $userData[$arrayDetail['UserMail']['user_id']]; ?></td>
                    <td>&nbsp;<?php echo $arrayDetail['UserMail']['mail_type']; ?></td>            
                    <td>&nbsp;<?php echo date('M j, Y', strtotime($arrayDetail['UserMail']['created'])); ?></td>
                </tr>  
                <?php
                $i++;
            }
        }
        ?>
        <tr>
            <td colspan="11" bgcolor="#ffffff" align="center">
                <div class="pagination">            
                    <?php
                    if (!empty($mailData)) {
                        echo $this->Element('pagination');
                    } else {
                        echo __("NO_RECORD_MESSAGE");
                    }
                    ?>              
                </div>
            </td>
        </tr>

        <tr bgcolor="#ffffff">
            <td colspan="11" valign="top">
                <table width="30%">
                    <tr>
                        <td width="10%">
                            <b><?php echo __('LEGENDS') ?> :- </b> 
                        </td>
                        <td width="20%">
                            <?php echo $this->html->image('/img/icons/16/icon_view.gif'); ?>
                            <?php echo __('VIEW') ?>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
<?php echo $this->Js->writeBuffer();?>